using System;

namespace Adoor.Domain.Tiers
{
	/// <summary>
	/// Summary description for Coordonnee.
	/// </summary>
	public abstract class Coordonnee
	{

		
	
		public virtual String Telephone
		{
			get
			{
				  if (ExternalBdd)
                      return this.m_local_telephone;
                else
                      return this.m_telephone;
			}
			set
			{
                if (ExternalBdd)
                    this.m_local_telephone = value;
                else
                    this.m_telephone = value;
			}
		}


        public virtual String Portable
        {
            get
            {
                if (ExternalBdd)
                    return this.m_local_portable;
                else
                    return this.m_portable;
            }
            set
            {
                if (ExternalBdd)
                    this.m_local_portable = value;
                else
                    this.m_portable = value;
            }
        }

		public virtual String Email
		{
			get
			{
				return this.m_email;
			}
			set
			{ 
				this.m_email = value;
			}
		}



		
		/// <summary>
		/// Called when user is creating a new entity.
		/// </summary>
		protected virtual void OnCreate(object[] args)
		{
            ExternalBdd = false; 
			Telephone = "";		
			Portable  = "";		
			Email = "";
		}
		
		/// <summary>
		/// Called when user is retreiving an entity from storage
		/// </summary>
		protected virtual void OnMaterialize()
		{

		}


        public virtual System.Boolean ExternalBdd
        {
            get
            {
                return this.m_externalBdd;
            }
            set
            {
                this.m_externalBdd = value;
            }
        }
		
		protected abstract System.String m_telephone { get; set; }
		
		protected abstract System.String m_portable { get; set; }
		
		protected abstract System.String m_email { get; set; }

        protected System.Boolean m_externalBdd;


        /* LOCAL STORAGES for EXTERNAL DATABASE*/

        private System.String m_local_telephone = string.Empty;

        private System.String m_local_portable = string.Empty;
		
		
	}
}
